﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Delphi.Mimir.Data.Entities.Raw.Mappings {
    public class RawEarningsEstimatesMap : EntityTypeConfiguration<RawEarningsEstimate> {
        public RawEarningsEstimatesMap() {
            
            /******************************************************************
            /* Table
            /*****************************************************************/
            ToTable("raw.eod_earnings_estimates");

            /******************************************************************
            /* Primary Key
            /*****************************************************************/
            HasKey(a => a.aee_id);

            /******************************************************************
            /* Index
            /*****************************************************************/
            // None

            /******************************************************************
            /* Relationships
            /*****************************************************************/
            // None

            /******************************************************************
            /* Properties
            /*****************************************************************/
            Property(a => a.aee_id)
                .IsRequired()
                .HasColumnName("aee_id");

            Property(a => a.aee_sym_cd)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("aee_sym_cd");

            Property(a => a.aee_exc_cd)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("aee_exc_cd");

            Property(a => a.aee_dt)
                .IsRequired()
                .HasColumnName("aee_dt");

            Property(a => a.aee_period)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("aee_period");

            Property(a => a.aee_curt_fg)
               .IsRequired()
               .HasColumnName("aee_curt_fg");

            Property(a => a.aee_avg_estimate)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aee_avg_estimate");

            Property(a => a.aee_low_estimate)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aee_low_estimate");

            Property(a => a.aee_high_estimate)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aee_high_estimate");

            Property(a => a.aee_year_ago)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aee_year_ago");

            Property(a => a.aee_nof_analyst)
                .IsOptional()
                .HasPrecision(18, 6)
                .HasColumnName("aee_nof_analyst");

            Property(a => a.aee_next_earnings_dt)
                .IsOptional()
                .HasColumnName("aee_next_earnings_dt");
        }
    }
}
